package cn.soxing.action.user;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;

import cn.soxing.pojo.BaseUser;
import cn.soxing.pojo.BaseUserDAO;

import com.opensymphony.xwork2.ActionSupport;

public class RegisterUser extends ActionSupport {

	private BaseUserDAO dao;
	
	private String type;
	private String loginId; 
	private String city;
	private String username;
	private String sex;
	private String email;
	private String telephone;
	private String certificatetype;
	private String certificatenum;
	private String password;
	
	/**
	 * @return
	 */
	public String execute() {
		BaseUser userinfo = new BaseUser(); 
		try {
			BeanUtils.copyProperties(userinfo, this);
			dao.save(userinfo);
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}



	public String getType() {
		return type;
	}



	public void setType(String type) {
		this.type = type;
	}



	public String getLoginId() {
		return loginId;
	}



	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}



	public String getCity() {
		return city;
	}



	public void setCity(String city) {
		this.city = city;
	}



	public String getUsername() {
		return username;
	}



	public void setUsername(String username) {
		this.username = username;
	}



	public String getSex() {
		return sex;
	}



	public void setSex(String sex) {
		this.sex = sex;
	}



	public String getEmail() {
		return email;
	}



	public void setEmail(String email) {
		this.email = email;
	}



	public String getTelephone() {
		return telephone;
	}



	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}



	public String getCertificatetype() {
		return certificatetype;
	}



	public void setCertificatetype(String certificatetype) {
		this.certificatetype = certificatetype;
	}



	public String getCertificatenum() {
		return certificatenum;
	}



	public void setCertificatenum(String certificatenum) {
		this.certificatenum = certificatenum;
	}



	public String getPassword() {
		return password;
	}



	public void setPassword(String password) {
		this.password = password;
	}



	public BaseUserDAO getDao() {
		return dao;
	}



	public void setDao(BaseUserDAO dao) {
		this.dao = dao;
	}
}